<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>lotex.Report</title>

<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<!-- Common Styles for the examples -->
<link rel="stylesheet" type="text/css" href="../examples.css" />

<!-- LIBS -->
<script type="text/javascript" src="../../jquery-latest.pack.js"></script>
<script type="text/javascript" src="../../jquery-plugins.js"></script>
<!-- ENDLIBS -->
<script type="text/javascript" src="../../ext-jquery-adapter.js"></script>
<script type="text/javascript" src="../../ext-all.js"></script>

</head>
<body>

<!--script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
<div id="rpt"></div>
<button id="mb1">Drawchart</button>
<div id="chartTest1"></div>
<div id="testSheetToTabel"></div>
</body>
</html>
<script type="text/javascript" src="lotex-all.js"></script>
<script type="text/javascript">
var dv,mt;
dv = new lotex.data.Table([
    ['门诊','急诊','挂号时间'],
    [367,32,8],
    [844,11,9],
    [1258,13,10],
    [1178,15,11],
    [207,8,12],
    [8,7,13],
    [427,16,14],
    [831,1,15],
    [451,0,16],
    [58,1,17],
    [1,0,19]
]);

function range(s,e){
    var ret = [];
    for(var i=s;i<=e;i++){
        ret.push(i);
    }
    return ret;
}
//Range('#:00',[0,23])
sj = new lotex.data.Table(range(0,23));
// how join
//dv.join(sj).on()
var w=dv.data[0].length;
var h=dv.data.length;

mt = new lotex.util.Matrix(w,h);
mt.setAll(function(x,y){return dv.getByXY(x,y)});

// 把sheet组装回table
var str = [];
str.push('<table border="1" cellspacing="0" cellpadding="0">');
for(var i=0; i<h; i++) {
    str.push('<tr>');
    for(var k=0; k<w; k++) {
        str.push('<td>');
        str.push(mt.get(k,i));
        str.push('</td>');
    }
    str.push('</tr>');
}
str.push('</table>');
$('#testSheetToTabel').html(str.join(''));

var y;
</script>